package com.greatwqs.wmall.user.provider.service.client;

import com.greatwqs.wmall.common.module.exception.AppException;
import com.greatwqs.wmall.common.module.exception.ErrorCode;
import com.greatwqs.wmall.user.client.service.ExceptionClientService;

import lombok.extern.slf4j.Slf4j;

import org.apache.dubbo.config.annotation.DubboService;

import java.io.FileNotFoundException;

/**
 * @author wang-qingsong
 * @since 2025/3/14
 */
@Slf4j
@DubboService
public class ExceptionClientServiceImpl implements ExceptionClientService {

    @Override
    public String runtimeException() {
        throw new RuntimeException("ExceptionClientServiceImpl RuntimeException");
    }

    @Override
    public String illegalArgumentException() {
        throw new IllegalArgumentException("ExceptionClientServiceImpl IllegalArgumentException");
    }

    @Override
    public String appException() throws AppException {
        throw new AppException(ErrorCode.USER_LOGIN_PASSWORD_ERROR);
    }

    @Override
    public String appExceptionNotThrowsDefine() {
        throw new AppException(ErrorCode.USER_LOGIN_PASSWORD_ERROR);
    }

    @Override
    public String fileNotFoundException() throws FileNotFoundException {
        throw new FileNotFoundException("ExceptionClientServiceImpl FileNotFoundException");
    }
}
